# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=haruna
pkgver=1.2.1
pkgrel=0
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://invent.kde.org/multimedia/haruna"
pkgdesc="Open-source video player built with Qt/QML and libmpv"
license="GPL-2.0-or-later AND GPL-3.0-or-later AND BSD-3-Clause"
depends="
	kirigami
	yt-dlp
	"
makedepends="
	extra-cmake-modules
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	mpvqt-dev
	ffmpeg-dev
	breeze-dev
	kconfig-dev
	kcoreaddons-dev
	kdoctools-dev
	kfilemetadata-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	kirigami-dev
	kxmlgui-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/multimedia/haruna.git"
source="https://download.kde.org/stable/haruna/$pkgver/haruna-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
56d15e18589d724f66b0040210c0dab679494625b0f9ead4e98b10e5f0c08b25efc6d1c77b17cbda1ca7d68039b7af2c4ee8e237cca973f05ff590423bcc9c4d  haruna-1.2.1.tar.xz
"
